Readme.txt for imce_gallery

27 November 2008

I liked the idea of IMCE Gallery, and that it provided a gallery function unique to site 
users, leveraging IMCEs per-user file-management and limit capabilities.  However, 
there were some things that bothered me about the 5.x-1.x-dev version of IMCE Gallery 
that needed fixing:
1.	Bugs.
2.	The assumption that it would be installed in the /modules directory, instead of the 
    /sites/all/modules directory.
3.	Private galleries were private to the owner, and no once else could see them.
4.	No captions on photos.
5.	Gallery description didnt show up in the gallery itself.
6.	Couldnt specify the number of images across in the thumbnail view of the 
    gallery.

So, I set about fixing these things.  What follows is a summary of the differences in this 
version from the 5.x-1.x-dev version.

1.	Starting with the .install file, other than fixing up some cosmetic indenting issues,
    a.	Added a caption column to the imce_gallery_items table
    b.	Created the table imce_private_viewer, to hold a gallery id and a user id in 
        each column.  Refer to the ERD.jpg file for the data model ERD, which 
        illustrates the relationships.  Fundamentally, if a gid and uid pair exist in 
        the table, then that user has permission to see that gallery.
    c.	Added two hook_update_N hooks to create the new table and to add the 
        column.
    d.	Updated the uninstall hook to remove the new table and delete the 
    imce_gallery_columns variable.
2.	For the .module itself gosh where do I begin?
    a.	Tried to comment all the functions with a header block.  Think I got them 
        all, although not all have @param and @return bits specified.
    b.	Removed text references to IMCE that end-users would see, since it 
        would just be confusing.  So, for example, the title on the page is not 
        Create gallery as opposed to Create IMCE gallery.
    c.	Tried to wrap most user-seen text in t() function calls.  Think I got them 
        all.
    d.	Added a number of new hook_menu items to facilitate the other features 
        below.
    e.	Created an imcegalleryaip, which I needed to tie gallery activity into the 
        Activity module.
    f.	Gallery list  a few changes here:
        i.	Updated the lead-in text (with accompanying test to see if the 
            gallery belongs to the current user) so that it give you instructions, 
            including a link to add a new gallery.
        ii.	Wrapped more classes around things to facilitate CSS themeing.
        iii.If its the users own galleries, for private galleries (which are now 
            marked with a (Private) after the gallery name), after the edit 
            link, there is now a who can view link, taking them to a separate 
            page listing all users who can view their gallery.  Checkboxes and 
            an Update button will allow removal of users from that list via 
            that page.
        iv.	If its another users gallery list, checks to see if the current user 
            can view any of the viewed-users private galleries, and for those 
            that can be viewed, lists them with a (Private) notation behind 
            them.
    g.	Adding, renaming, changing the description of, and deleting a gallery now 
        invokes the imcegalleryapi, with separate $ops for each action, and a slew 
        of passed arguments to see what changed.
    h.	Gallery display  a few changes here too:
        i.	Put the gallery description above the items.
        ii.	Even if the gallery is empty, a Back to galleries link is there.
        iii.Captions appear below each gallery item.
        iv.	A new IMCE Gallery Admin Setting allows specification of how 
            many images across / columns there should be.  Five didnt work 
            for my theme, so now the administrator can configure this.
        v.	If the gallery belongs to the current user, after the caption for each 
            image, three new links appear:
            1.	edit  edit the gallery caption
            2.	remove  remove the item from this gallery
            3.	move  move the item to another gallery
    i.	Add an item to a gallery, or move it to another gallery  on both of these 
        forms, there is a field for adding a caption to the item.  Images can appear 
        in more than one gallery, in fact, and can have separate captions in each 
        gallery.  Also, the submit handler for both of these forms invokes the 
        imcegalleryapi to notify any interested modules (such as the contrib. 
        module for activity) that something has happened.
    j.	Created a form to appear on the profile page of a user other than the 
        currently logged-in user to permit checking-off which of your private 
        galleries you want that user to see.  Implemented via hook_user and a 
        form.
    k.	Created function imce_gallery_user_may_see to determine if a gallery 
        may be seen by a user, based upon the gallery being public, the user being 
        the gallery owner, or otherwise if the private gallery has the specified user 
        as an allowed viewer.  Used in hook menu to fix a security problem where 
        previously a user could get to a gallery if they knew the gallery number by 
        supplying it in the URL.
3.	For the .js file, a couple of changes:
    a.	Fixed paths in the file so that they now look in 
        /sites/all/modules/imce_gallery.
    b.	Added the ability for the image captions to be displayed below the image 
        in the lightbox.
4.	The CSS file now includes a number of classes for theming things better.  This 
    includes a drop-shadow effect now in the thumbnail view of the galleries, as well 
    as classes for the captions, descriptions, etc.
5.	And last, but not least, a contrib. module for the Activity module that lets IMCE 
    Gallery activity show up in the activity lists that that module provides.  I based 
    this on the 5.x-2.1-2 version of Activity, as Ive not upgraded yet.

OK, I think thats about it for now.  I have this running on a production site, and its 
working quite well now.  Hope it helps someone else.

shawn
